home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / m68k / 350 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.0 KB

  1. Path: watnews.watson.ibm.com!kgold
  2. From: kgold@watson.ibm.com (Ken Goldman)
  3. Newsgroups: comp.sys.m68k
  4. Subject: Re: What is propper sequence for clearing CISR Register bits
  5. Date: 7 Mar 1996 14:57:01 GMT
  6. Organization: IBM T.J. Watson Research Center
  7. Distribution: world
  8. Message-ID: <4hmtft$kal@watnews1.watson.ibm.com>
  9. References: <4hfola$2b8@python.microcom.com>
  10. NNTP-Posting-Host: beta.watson.ibm.com
  11. Keywords: CISR 68360 Event Handling
  12.  
  13. spellman@microcom.com (Roger Spellman) writes:
  14. |> The MC68360 QUICC manual gives an example of an SCC Interupt Handler.
  15. |> In Rev 1 of the manual, it is at the very end of chapter 7, in section 
  16. |> 7.15.6.2, page 7-381.  In this example, the SCC1 bit in the CISR is 
  17. |> cleared *AFTER* the events for SCC1 are handled.  To me, this seems 
  18. |> backwards.
  19. |> 
  20. |> Can someone tell me the right way to do it, and explain to me why?
  21. |> 
  22.  
  23. I think the example is right, but that it normally would not matter.
  24.  
  25. There are two priorities to understand.
  26.  
  27. 1 - Processor priority - 0 - 7, set by processor status register (SR)
  28. 2 - CPM priority - interrupts within the CPM, set by CICR, typically 4
  29.  
  30. All CPM interrupts are at the same processor priority.
  31.  
  32. When a bit in the CISR is set, it prevents interrupts at the same or
  33. lower CPM priority.  If you cleared the CISR bit at the beginning of
  34. your handler, lower priority CPM events could preempt your handler.
  35. This might be OK, but is usually not desired.
  36.  
  37. Entering the handler, the processor priority in the SR is set to the
  38. level of the CPM interrupt.  This prevents all other CPM interrupts.
  39. Normally, the SR priority drops when the RTE is executed.  In that
  40. case, it really doesn't matter when CISR clears.
  41.  
  42. But if you have a higher processor priority interrupt during the
  43. handler, and that interrupt handler lowers the SR priority below that
  44. of the CPM (not normally done), then you need to clear CISR at the end
  45. of the handler to prevent lower priority CPM interrupts.
  46.  
  47. Whew!  The tech writers on the 68360 earned their paycheck.
  48.  
  49. -- 
  50. Ken Goldman   kgold@watson.ibm.com   914-784-7396
  51.